package durak.client.view;

import java.awt.FlowLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import durak.client.control.ICardListener;
import durak.common.model.Card;
import durak.common.model.Hand;

public class HandView extends DurakPanel implements MouseListener {

	Hand cards;
	/**
	 * Create the panel.
	 */
	public HandView() {
		setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
        setVisible(true);
	}

	public void showHand(Hand hand, ICardListener cardListener) {
		this.cards = hand;
		clearCards();
		for (Card card : hand) {
			CardLabel cardLabel = new CardLabel(card, cardListener);
			add(cardLabel);
		}
		revalidate();
		repaint();
	}

	public void clearCards() {
		removeAll();
	}
	
	@Override
	public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

}
